
package tk.tankpao.amq.consumer.queue;

import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageListener;
import javax.jms.TextMessage;

import org.springframework.stereotype.Component;

/**
 * 
 * @author liang
 * @description  队列消息监听器
 * 
 */
@Component("sampleQueueReceiver")
public class SampleQueueReceiver implements MessageListener {
	static public int i = 0;
	@Override
	public void onMessage(Message message) {
		try {
			((TextMessage)message).getText();
			i++;
		} catch (JMSException e) {
			e.printStackTrace();
		}
	}

}
